﻿using SqlSugar;

namespace HY.Model
{
    public class BaseModel : IDeleted
    {
        /// <summary>
        /// id
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public long Id { get; set; }

        /// <summary>
        /// 新增时间
        /// </summary>
        [SugarColumn(ColumnName = "add_time")]
        public DateTime? AddTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnName = "update_time")]
        public DateTime? UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 删除标记
        /// </summary>
        [SugarColumn(ColumnName = "is_delete", DefaultValue = "0")]
        public bool IsDelete { get; set; } = false;
    }

    /// <summary>
    /// 过滤器使用，自动追加
    /// </summary>
    public interface IDeleted
    {
        public bool IsDelete { get; set; }
    }
}
